package com.woniuxy.controller;

import com.github.pagehelper.PageInfo;
import com.woniuxy.entitys.TbSendmessage;
import com.woniuxy.services.SendMessageService;
import com.woniuxy.utils.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class SendMessageController {

    @Autowired
    private SendMessageService sendMessageService;
    /**
     * 查询消息发送表信息
     */
    @PostMapping("/sendMessage/list")
    public ResultVO getSendMessageList(@RequestBody Map<String,Object> map){
        Integer pageNum = (Integer) map.get("pageNum");
        Integer pageSize = (Integer) map.get("pageSize");
        PageInfo<TbSendmessage> pageInfo = sendMessageService.getSendMessageList(pageNum, pageSize);
        return pageInfo!=null?ResultVO.success("success",pageInfo):ResultVO.failure("failed");
    }
}
